package is.olsenolsen;
//
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;

public class BirtaSpil
{
	public BirtaSpil(){
		// T�mur klasasmi�ur.
	}
	//-    -    -    -    -    -    -
	/**
	 * @category stef
	 * @tilgangur Setja upp mynd � s�ti � "spilabor�i", sem skj�bor� � Android snjalls�ma
	 */
	public static void setjaBakgrunn (ImageView mynd,
			                          FrameLayout.LayoutParams undirbuaFyrirBakgrunn,
			                          int vidd, int haed, int xHnit, int yHnit, int resid)
	{
		undirbuaFyrirBakgrunn.height     = haed;
		undirbuaFyrirBakgrunn.width      = vidd;
		undirbuaFyrirBakgrunn.topMargin  = yHnit;
		undirbuaFyrirBakgrunn.leftMargin = xHnit;
		mynd.setLayoutParams(undirbuaFyrirBakgrunn);
		mynd.setBackgroundResource(resid);
	} // setjaUppMynd ( . . . ).
	// -    -    -    -    -    -    -
	/**
	 * Sama stefi� og a� ofan, en me� ��ru nafni, til �ess a� nafni� sk�rir tilgang stefsins
	 * 
	 * @category stef
	 * @tilgangur Setja upp mynd � s�ti � "spilabor�i", sem skj�bor� � Android snjalls�ma
	 */
	public static void setjaSpil (ImageView mynd,
			                      FrameLayout.LayoutParams undirbuaFyrirSpil,
			                      int vidd, int haed, int xHnit, int yHnit, int resid)
	{
		undirbuaFyrirSpil.height     = haed;
		undirbuaFyrirSpil.width      = vidd;
		undirbuaFyrirSpil.topMargin  = yHnit;
		undirbuaFyrirSpil.leftMargin = xHnit;
		mynd.setLayoutParams(undirbuaFyrirSpil);
		mynd.setBackgroundResource(resid);
	} // setjaUppMynd ( . . . ).
	//-    -    -    -    -    -    -
	//
	/**
	 * 
	 */
	public static void BirtaStortSpil(ImageView dragaSpil, int dragaNyttSpil)
	{
		/*
		 * Visa�ula: Flokka ni�ur eftir tilfelli,
		 * hva�a spil var dregin, til �ess a� h�gt
		 * s� a� birta r�tta spili� � notendavi�m�ti�.
		 */
		switch (dragaNyttSpil)
		{
		case (Fastar.SPADAR_ASINN):
			/*
			 * Fastayr�ing: R�kseg�in a� spa�ar �s var dregin er
			 * s�nn. Aflei�ing �ess er a� n�na ver�ur Spa�ar �sinn
			 * l�tin sn�a � loft upp, sem jafngildir �v� a� notandinn
			 * getur n�na s�� spili� s�� fr� notendavi�m�tinu.
			 */
			dragaSpil.setBackgroundResource(R.drawable.s01_stort);
			break;
		case (Fastar.SPADAR_TVISTUR):
			/*
			 * Svipu� fastayr�ing og a� ofan nema n�na er
			 * um a� r��a Spa�ar Tvistinn.
			 * � n�stu tilfellin eru �ll hin spilin a� "J�ker".
			 */
			dragaSpil.setBackgroundResource(R.drawable.s02_stort);
			break;
		case (Fastar.SPADAR_THRISTUR):
			dragaSpil.setBackgroundResource(R.drawable.s03_stort);
			break;
		case (Fastar.SPADAR_FJARKUR):
			dragaSpil.setBackgroundResource(R.drawable.s04_stort);
			break;
		case (Fastar.SPADAR_FIMMUR):
			dragaSpil.setBackgroundResource(R.drawable.s05_stort);
			break;
		case (Fastar.SPADAR_SEXA):
			dragaSpil.setBackgroundResource(R.drawable.s06_stort);
			break;
		case (Fastar.SPADAR_SJOA):
			dragaSpil.setBackgroundResource(R.drawable.s07_stort);
			break;
		case (Fastar.SPADAR_ATTA):
			dragaSpil.setBackgroundResource(R.drawable.s08_stort);
			break;
		case (Fastar.SPADAR_NIA):
			dragaSpil.setBackgroundResource(R.drawable.s09_stort);
			break;
		case (Fastar.SPADAR_TIA):
			dragaSpil.setBackgroundResource(R.drawable.s10_stort);
			break;
		case (Fastar.SPADAR_GOSI):
			dragaSpil.setBackgroundResource(R.drawable.s11_stort);
			break;
		case (Fastar.SPADAR_DROTTNING):
			dragaSpil.setBackgroundResource(R.drawable.s12_stort);
			break;
		case (Fastar.SPADAR_KONUNGUR):
			dragaSpil.setBackgroundResource(R.drawable.s13_stort);
			break;
		case (Fastar.HJARTAR_ASINN):
			dragaSpil.setBackgroundResource(R.drawable.h01_stort);
			break;
		case (Fastar.HJARTAR_TVISTUR):
			dragaSpil.setBackgroundResource(R.drawable.h02_stort);
			break;
		case (Fastar.HJARTAR_THRISTUR):
			dragaSpil.setBackgroundResource(R.drawable.h03_stort);
			break;
		case (Fastar.HJARTAR_FJARKUR):
			dragaSpil.setBackgroundResource(R.drawable.h04_stort);
			break;
		case (Fastar.HJARTAR_FIMMUR):
			dragaSpil.setBackgroundResource(R.drawable.h05_stort);
			break;
		case (Fastar.HJARTAR_SEXA):
			dragaSpil.setBackgroundResource(R.drawable.h06_stort);
			break;
		case (Fastar.HJARTAR_SJOA):
			dragaSpil.setBackgroundResource(R.drawable.h07_stort);
			break;
		case (Fastar.HJARTAR_ATTA):
			dragaSpil.setBackgroundResource(R.drawable.h08_stort);
			break;
		case (Fastar.HJARTAR_NIA):
			dragaSpil.setBackgroundResource(R.drawable.h09_stort);
			break;
		case (Fastar.HJARTAR_TIA):
			dragaSpil.setBackgroundResource(R.drawable.h10_stort);
			break;
		case (Fastar.HJARTAR_GOSI):
			dragaSpil.setBackgroundResource(R.drawable.h11_stort);
			break;
		case (Fastar.HJARTAR_DROTTNING):
		    dragaSpil.setBackgroundResource(R.drawable.h12_stort);
		    break;
		case (Fastar.HJARTAR_KONUNGUR):
			//dragaSpil.setBackgroundResource(R.drawable.h13_stort);
			dragaSpil.setBackgroundResource(R.drawable.h13_stort);
			break;
		case (Fastar.TIGUL_ASINN):
			dragaSpil.setBackgroundResource(R.drawable.t01_stort);
			break;
		case (Fastar.TIGUL_TVISTUR):
			dragaSpil.setBackgroundResource(R.drawable.t02_stort);
			break;
		case (Fastar.TIGUL_THRISTUR):
			dragaSpil.setBackgroundResource(R.drawable.t03_stort);
			break;
		case (Fastar.TIGUL_FJARKUR):
			dragaSpil.setBackgroundResource(R.drawable.t04_stort);
			break;
		case (Fastar.TIGUL_FIMMUR):
			dragaSpil.setBackgroundResource(R.drawable.t05_stort);
			break;
		case (Fastar.TIGUL_SEXA):
			dragaSpil.setBackgroundResource(R.drawable.t06_stort);
			break;
		case (Fastar.TIGUL_SJOA):
			dragaSpil.setBackgroundResource(R.drawable.t07_stort);
			break;
		case (Fastar.TIGUL_ATTA):
			dragaSpil.setBackgroundResource(R.drawable.t08_stort);
			break;
		case (Fastar.TIGUL_NIA):
			dragaSpil.setBackgroundResource(R.drawable.t09_stort);
			break;
		case (Fastar.TIGUL_TIA):
			dragaSpil.setBackgroundResource(R.drawable.t10_stort);
			break;
		case (Fastar.TIGUL_GOSI):
			dragaSpil.setBackgroundResource(R.drawable.t11_stort);
			break;
		case (Fastar.TIGUL_DROTTNING):
			dragaSpil.setBackgroundResource(R.drawable.t12_stort);
			break;
		case (Fastar.TIGUL_KONUNGUR):
			dragaSpil.setBackgroundResource(R.drawable.t13_stort);
			break;
		case (Fastar.LAUFAR_ASINN):
			dragaSpil.setBackgroundResource(R.drawable.l01_stort);
			break;
		case (Fastar.LAUFAR_TVISTUR):
			dragaSpil.setBackgroundResource(R.drawable.l02_stort);
			break;
		case (Fastar.LAUFAR_THRISTUR):
			dragaSpil.setBackgroundResource(R.drawable.l03_stort);
			break;
		case (Fastar.LAUFAR_FJARKUR):
			dragaSpil.setBackgroundResource(R.drawable.l04_stort);
			break;
		case (Fastar.LAUFAR_FIMMUR):
			dragaSpil.setBackgroundResource(R.drawable.l05_stort);
			break;
		case (Fastar.LAUFAR_SEXA):
			dragaSpil.setBackgroundResource(R.drawable.l06_stort);
			break;
		case (Fastar.LAUFAR_SJOA):
			dragaSpil.setBackgroundResource(R.drawable.l07_stort);
			break;
		case (Fastar.LAUFAR_ATTA):
			dragaSpil.setBackgroundResource(R.drawable.l08_stort);
			break;
		case (Fastar.LAUFAR_NIA):
			dragaSpil.setBackgroundResource(R.drawable.l09_stort);
			break;
		case (Fastar.LAUFAR_TIA):
			dragaSpil.setBackgroundResource(R.drawable.l10_stort);
			break;
		case (Fastar.LAUFAR_GOSI):
			dragaSpil.setBackgroundResource(R.drawable.l11_stort);
			break;
		case (Fastar.LAUFAR_DROTTNING):
			dragaSpil.setBackgroundResource(R.drawable.l12_stort);
			break;
		case (Fastar.LAUFAR_KONUNGUR):
			dragaSpil.setBackgroundResource(R.drawable.l13_stort);
			break;
		case (Fastar.RAUDUR_JOKER):
			//dragaSpil.setBackgroundResource(R.drawable.j01_stort);
			break;
		case (Fastar.GRAENN_JOKER):
			//dragaSpil.setBackgroundResource(R.drawable.j02_stort);
			break;
		case (Fastar.BLAR_JOKER):
			//dragaSpil.setBackgroundResource(R.drawable.j03_stort);
			break;
		default:
			dragaSpil.findViewById(R.drawable.h12_stort);
			break;
		} // case
		//
	} // public void BirtaEittSpil(ImageView dragaSpil, int dragaNyttSpil)
	//
	/**
	 * 
	 */
	public static void BirtaLitidSpil(ImageView dragaSpil, int dragaNyttSpil)
	{
		/*
		 * Visa�ula: Flokka ni�ur eftir tilfelli,
		 * hva�a spil var dregin, til �ess a� h�gt
		 * s� a� birta r�tta spili� � notendavi�m�ti�.
		 */
		switch (dragaNyttSpil)
		{
		case (Fastar.SPADAR_ASINN):
			/*
			 * Fastayr�ing: R�kseg�in a� spa�ar �s var dregin er
			 * s�nn. Aflei�ing �ess er a� n�na ver�ur Spa�ar �sinn
			 * l�tin sn�a � loft upp, sem jafngildir �v� a� notandinn
			 * getur n�na s�� spili� s�� fr� notendavi�m�tinu.
			 */
			dragaSpil.setImageResource(R.drawable.s01);
			break;
		case (Fastar.SPADAR_TVISTUR):
			/*
			 * Svipu� fastayr�ing og a� ofan nema n�na er
			 * um a� r��a Spa�ar Tvistinn.
			 * � n�stu tilfellin eru �ll hin spilin a� "J�ker".
			 */
			dragaSpil.setImageResource(R.drawable.s02);
			break;
		case (Fastar.SPADAR_THRISTUR):
			dragaSpil.setImageResource(R.drawable.s03);
			break;
		case (Fastar.SPADAR_FJARKUR):
			dragaSpil.setImageResource(R.drawable.s04);
			break;
		case (Fastar.SPADAR_FIMMUR):
			dragaSpil.setImageResource(R.drawable.s05);
			break;
		case (Fastar.SPADAR_SEXA):
			dragaSpil.setImageResource(R.drawable.s06);
			break;
		case (Fastar.SPADAR_SJOA):
			dragaSpil.setImageResource(R.drawable.s07);
			break;
		case (Fastar.SPADAR_ATTA):
			dragaSpil.setImageResource(R.drawable.s08);
			break;
		case (Fastar.SPADAR_NIA):
			dragaSpil.setImageResource(R.drawable.s09);
			break;
		case (Fastar.SPADAR_TIA):
			dragaSpil.setImageResource(R.drawable.s10);
			break;
		case (Fastar.SPADAR_GOSI):
			dragaSpil.setImageResource(R.drawable.s11);
			break;
		case (Fastar.SPADAR_DROTTNING):
			dragaSpil.setImageResource(R.drawable.s12);
			break;
		case (Fastar.SPADAR_KONUNGUR):
			dragaSpil.setImageResource(R.drawable.s13);
			break;
		case (Fastar.HJARTAR_ASINN):
			dragaSpil.setImageResource(R.drawable.h01);
			break;
		case (Fastar.HJARTAR_TVISTUR):
			dragaSpil.setImageResource(R.drawable.h02);
			break;
		case (Fastar.HJARTAR_THRISTUR):
			dragaSpil.setImageResource(R.drawable.h03);
			break;
		case (Fastar.HJARTAR_FJARKUR):
			dragaSpil.setImageResource(R.drawable.h04);
			break;
		case (Fastar.HJARTAR_FIMMUR):
			dragaSpil.setImageResource(R.drawable.h05);
			break;
		case (Fastar.HJARTAR_SEXA):
			dragaSpil.setImageResource(R.drawable.h06);
			break;
		case (Fastar.HJARTAR_SJOA):
			dragaSpil.setImageResource(R.drawable.h07);
			break;
		case (Fastar.HJARTAR_ATTA):
			dragaSpil.setImageResource(R.drawable.h08);
			break;
		case (Fastar.HJARTAR_NIA):
			dragaSpil.setImageResource(R.drawable.h09);
			break;
		case (Fastar.HJARTAR_TIA):
			dragaSpil.setImageResource(R.drawable.h10);
			break;
		case (Fastar.HJARTAR_GOSI):
			dragaSpil.setImageResource(R.drawable.h11);
			break;
		case (Fastar.HJARTAR_DROTTNING):
			dragaSpil.setImageResource(R.drawable.h12);
			break;
		case (Fastar.HJARTAR_KONUNGUR):
			dragaSpil.setImageResource(R.drawable.h13);
			break;
		case (Fastar.TIGUL_ASINN):
			dragaSpil.setImageResource(R.drawable.t01);
			break;
		case (Fastar.TIGUL_TVISTUR):
			dragaSpil.setImageResource(R.drawable.t02);
			break;
		case (Fastar.TIGUL_THRISTUR):
			dragaSpil.setImageResource(R.drawable.t03);
			break;
		case (Fastar.TIGUL_FJARKUR):
			dragaSpil.setImageResource(R.drawable.t04);
			break;
		case (Fastar.TIGUL_FIMMUR):
			dragaSpil.setImageResource(R.drawable.t05);
			break;
		case (Fastar.TIGUL_SEXA):
			dragaSpil.setImageResource(R.drawable.t06);
			break;
		case (Fastar.TIGUL_SJOA):
			dragaSpil.setImageResource(R.drawable.t07);
			break;
		case (Fastar.TIGUL_ATTA):
			dragaSpil.setImageResource(R.drawable.t08);
			break;
		case (Fastar.TIGUL_NIA):
			dragaSpil.setImageResource(R.drawable.t09);
			break;
		case (Fastar.TIGUL_TIA):
			dragaSpil.setImageResource(R.drawable.t10);
			break;
		case (Fastar.TIGUL_GOSI):
			dragaSpil.setImageResource(R.drawable.t11);
			break;
		case (Fastar.TIGUL_DROTTNING):
			dragaSpil.setImageResource(R.drawable.t12);
			break;
		case (Fastar.TIGUL_KONUNGUR):
			dragaSpil.setImageResource(R.drawable.t13);
			break;
		case (Fastar.LAUFAR_ASINN):
			dragaSpil.setImageResource(R.drawable.l01);
			break;
		case (Fastar.LAUFAR_TVISTUR):
			dragaSpil.setImageResource(R.drawable.l02);
			break;
		case (Fastar.LAUFAR_THRISTUR):
			dragaSpil.setImageResource(R.drawable.l03);
			break;
		case (Fastar.LAUFAR_FJARKUR):
			dragaSpil.setImageResource(R.drawable.l04);
			break;
		case (Fastar.LAUFAR_FIMMUR):
			dragaSpil.setImageResource(R.drawable.l05);
			break;
		case (Fastar.LAUFAR_SEXA):
			dragaSpil.setImageResource(R.drawable.l06);
			break;
		case (Fastar.LAUFAR_SJOA):
			dragaSpil.setImageResource(R.drawable.l07);
			break;
		case (Fastar.LAUFAR_ATTA):
			dragaSpil.setImageResource(R.drawable.l08);
			break;
		case (Fastar.LAUFAR_NIA):
			dragaSpil.setImageResource(R.drawable.l09);
			break;
		case (Fastar.LAUFAR_TIA):
			dragaSpil.setImageResource(R.drawable.l10);
			break;
		case (Fastar.LAUFAR_GOSI):
			dragaSpil.setImageResource(R.drawable.l11);
			break;
		case (Fastar.LAUFAR_DROTTNING):
			dragaSpil.setImageResource(R.drawable.l12);
			break;
		case (Fastar.LAUFAR_KONUNGUR):
			dragaSpil.setImageResource(R.drawable.l13);
			break;
		case (Fastar.RAUDUR_JOKER):
			dragaSpil.setImageResource(R.drawable.j01);
			break;
		case (Fastar.GRAENN_JOKER):
			dragaSpil.setImageResource(R.drawable.j02);
			break;
		case (Fastar.BLAR_JOKER):
			dragaSpil.setImageResource(R.drawable.j03);
			break;
		default:
			dragaSpil.setImageResource(R.drawable.h12);
			break;
		} // case
		//
	} // public void BirtaEittSpil(ImageView dragaSpil, int dragaNyttSpil)
	//
} // public class BirtaSpil.
